Mega Code Archive
Math Numeric Functions
1) (MOD(4, 0)) will return a null value
2) A NULL value will be returned if you try to divide by zero
3) ABS(X) returns the absolute value of X
4) ACOS(X) returns the arc cosine of X
5) Addition
6) Arithmetic Operators
7) ASIN(X) returns the arc sine of X Returns NULL if X is not in the range -1 to 1
8) ATAN(X) returns the arc tangent of X
9) ATAN(Y,X), ATAN2(Y,X) returns the arc tangent of the two variables X and Y
10) BIT_AND(expr)
11) BIT_OR(expr)
12) BIT_XOR(expr)
13) CEILING(X), CEIL(X) returns the smallest integer value not less than X
14) Ceiling a column
15) CONV(N,10,16)
16) CONV(N,10,2)
17) CONV(N,10,8)
18) CONV(N,from_base,to_base)
19) COS(X) returns the cosine of X, where X is given in radians
20) COT(X) returns the cotangent of X
21) CRC32(expr) returns a cyclic redundancy check value and returns a 32-bit unsigned value
22) DEGREES(X) returns the argument X, converted from radians to degrees
23) Division
24) Division by zero produces a NULL result
25) EXP(X) returns the value of e (the base of natural logarithms) raised to the power of X
26) FLOOR(X) returns the largest integer value not greater than X
27) Flooring a column
28) FORMAT(X,D) formats the number X to a format like #,###,### ##, rounded to D decimal places, and returns the result
29) Get the absolute value for a column
30) How rounding differs for exact and approximate values
31) Integer division
32) LN(X) returns the natural logarithm of X; that is, the base-e logarithm of X
33) LOG(X), LOG(B,X)
34) LOG10(X) returns the base-10 logarithm of X
35) LOG2(X) returns the base-2 logarithm of X
36) MOD(N,0) returns NULL
37) MOD(N,M), N % M, N MOD M
38) Modulo operation (%)
39) Multiplication
40) Numeric Functions
41) OCT(N)
42) PI() returns the value of D (pi)
43) POW(X,Y), POWER(X,Y) returns the value of X raised to the power of Y
44) RADIANS(X) returns the argument X, converted from degrees to radians
45) RAND(), RAND(N) returns a random floating-point value v in the range 0 = v 1 0
46) RAND(20)
47) ROUND(1 298, 0)
48) ROUND(1 298, 1)
49) ROUND(150 000,2)ROUND(150,2)
50) ROUND(23 298, -1)
51) ROUND(X), ROUND(X,D) rounds the argument X to D decimal places
52) Rounding value in a column
53) SELECT ACOS(1 0001)
54) SELECT ASIN(foo)
55) SELECT CONV(0xa,10,10)
56) SELECT CONV(10,10,10)
57) SELECT CONV(-17,10,-18)
58) SELECT TRUNCATE(545,-2)
59) SIGN(X) returns the sign of the argument as -1, 0, or 1, depending on whether X is negative, zero, or positive
60) SIN(X) returns the sine of X, where X is given in radians
61) Sign a list of data
62) SQRT(-16)
63) SQRT(X) returns the square root of a non-negative number X
64) Subtraction
65) SUM then Multiply
66) TAN(X) returns the tangent of X, where X is given in radians
67) The modulo function returns the remainder of two numbers
68) To add the totals of both columns for every row
69) To obtain a random integer in the range the range 7 = R 12
70) Total the two columns and then subtract them
71) TRUNCATE(1 999,0)
72) TRUNCATE(-1 999,1)
73) TRUNCATE(10 28100,0)
74) TRUNCATE(122,-2)
75) TRUNCATE(X,D) returns the number X, truncated to D decimal places
76) Unary minus
77) Using Arithmetic Operators in select statement
78) Using EXP function with data in a table
79) Using LN function with data in a table
80) Using LOG with data in a table